<%
if Request.Cookies(sitecookiename)("admin_name")="" or Request.Cookies(sitecookiename)("admin_pass")="" or Request.Cookies(sitecookiename)("admin_class")="" then
Response.Cookies(sitecookiename)("admin_name")=""
Response.Cookies(sitecookiename)("admin_pass")=""
Response.Cookies(sitecookiename)("admin_class")=""
response.redirect "ad_login.asp"
response.end
else
admin_name=Request.Cookies(sitecookiename)("admin_name")
set rs=server.createobject("adodb.recordset")
sql="select * from admin where admin_name='"&admin_name&"'"
rs.open sql,conn,1,1
if rs.eof then
Response.Cookies(sitecookiename)("admin_name")=""
Response.Cookies(sitecookiename)("admin_pass")=""
Response.Cookies(sitecookiename)("admin_class")=""
response.redirect "ad_login.asp"
response.end
else
admin_pass=rs("admin_pass")
end if
rs.close
set rs=nothing
if trim(Request.Cookies(sitecookiename)("admin_pass"))<>trim(admin_pass) then
Response.Cookies(sitecookiename)("admin_name")=""
Response.Cookies(sitecookiename)("admin_pass")=""
Response.Cookies(sitecookiename)("admin_class")=""
response.redirect "ad_login.asp"
response.end
end if
end if
%>